home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / Blitz2 / BlitzFaq / FaqLists / WBScreenclone.txt < prev    next >
Encoding:
Text File  |  1996-09-03  |  2.5 KB  |  100 lines

  1. ;first whe go to amiga mode
  2. AMIGA
  3. WBStartup
  4. NoCli
  5.  
  6. ;use tags
  7. NEWTYPE .tags
  8. a.l:b.l:c.l:d.l:e.l:f.l:g.l:h.l:i.l:j.l
  9. k.l:l.l:m.l:n.l:o.l:p.l:q.l:r.l:s.l:t.l
  10. u.l:v.l:w.l:x.l:y.l:z.l
  11. End NEWTYPE
  12.  
  13. ;define constants
  14. #SA_Left        =$80000021
  15. #SA_Top         =$80000022
  16. #SA_Width       =$80000023
  17. #SA_Height      =$80000024
  18. #SA_Depth       =$80000025
  19. ;#SA_DetailPen  =$80000026
  20. ;#SA_BlockPen   =$80000027
  21. #SA_Type        =$8000002D
  22. #SA_DisplayID   =$80000032
  23. #SA_Overscan    =$80000034
  24. #SA_PubName     =$8000002F
  25. #SA_PubTask     =$80000031
  26. #SA_PubSig      =$80000030
  27. #SA_LikeWorkbench=$80000047
  28.  
  29. #PUBLICSCREEN=$0002
  30. naam$="Requestor"+Chr$(0)
  31.  
  32. ;for getting default wb settings i make
  33. ;first the workbench screen my screen
  34.  
  35. WBToScreen 0
  36. *pointertos.Screen=Addr Screen(0)
  37. *screenstruct.Screen=*pointertos.Screen\NextScreen
  38.  
  39. ;define  the  tags  and do NOT use wbwidth or wbhight function
  40. ;they are not exactly correct.
  41. ;Workbench  resolutions  higher  than 640x512 will result to a
  42. ;wbwidth=640 and  wbhight=512 So, a piccasso screen of 800x600
  43. ;will   not   work   exactly   like   it   has   to  be.   Use
  44. ;*screenstruct.Screen\Width and *screenstruct.Screen\Height for
  45. ;the exact results !
  46.  
  47. ;Acid Software, something to fix. ;-)
  48.  
  49. scr.tags\a=#SA_Left          ,0
  50. scr.tags\c=#SA_Top           ,0
  51. scr.tags\e=#SA_Width         ,*screenstruct.Screen\Width
  52. scr.tags\g=#SA_Height        ,*screenstruct.Screen\Height
  53. scr.tags\i=#SA_Depth         ,WBDepth
  54. scr.tags\k=#SA_Type          ,#PUBLICSCREEN
  55. scr.tags\m=#SA_PubSig        ,0
  56. scr.tags\o=#SA_PubTask       ,FindTask_(0)
  57. scr.tags\q=#SA_PubName       ,&naam$
  58.  
  59. ;finaly this was what i am looking for ! Getting the exact viewmode !
  60. scr.tags\s=#SA_DisplayID     ,GetVPModeID_(*screenstruct.Screen\_ViewPort)
  61.  
  62. scr.tags\u=#SA_Overscan      ,1
  63. scr.tags\w=#SA_LikeWorkbench ,1
  64. scr.tags\y=0                 ,0
  65.  
  66. ;now open my own screen, yupi !
  67. ScreenTags 0,titel$,&scr.tags
  68. Use Screen 0
  69.  
  70. ;again for ower new screen
  71. *pointertos.Screen=Addr Screen(0)
  72. *screenstruct.Screen=*pointertos.Screen\NextScreen
  73.  
  74. ;make my screen public screen !
  75. If PubScreenStatus_(*screenstruct.Screen,0)=0
  76.   Nprint "Could not make public !"
  77. EndIf
  78.  
  79. ;open a window
  80. Window 0,0,0,300,200,$1+$2+$8,"TEST",1,0
  81. Use Window 0
  82.  
  83. wait for windowclose gadget
  84. Repeat
  85.   ev.l=WaitEvent
  86. Until ev.l=$200
  87.  
  88. CloseWindow 0
  89.  
  90. *pointertos.Screen=Addr Screen(0)
  91. *screenstruct.Screen=*pointertos.Screen\NextScreen
  92.  
  93. ;this will hold program end before every window is closed !
  94.  
  95. While PubScreenStatus_(*screenstruct.Screen,1)=0
  96.   Delay_(50)
  97. Wend
  98.  
  99. End
  100.